package com.feihong.txgw.ui.activity.order;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.feihong.txgw.R;
import com.feihong.txgw.message.LoginMessage;
import com.feihong.txgw.ui.activity.base.BaseActivity;

import butterknife.BindView;

/**
 * Created by Sabirjan on 2017/8/8.
 * TXGWApp.
 * 飞宏电子
 * <p>
 * 付款成功 ,0元订单成功提交后进入的页面
 */

public class PaySuccessActivity extends BaseActivity {

    public static final String INTENT_TYPE = "type";

    /**
     * 支付成功
     */
    public static final String TYPE_PAY_SUCCESS = "paysuccess";
    /**
     * 提交成功
     */
    public static final String TYPE_SUBMIT_SUCCESS = "submitsuccess";

    private String type = TYPE_PAY_SUCCESS;

    @BindView(R.id.pay_success_btn)
    LinearLayout mPaySuccessBtn;
    @BindView(R.id.txt_type)
    TextView textView;
    @Override
    public void setTheme() {

    }

    @Override
    public int setLayoutID() {
        return R.layout.activity_paysuccess;
    }


    @Override
    public void initView(Bundle savedInstanceState) {
        if (!TextUtils.isEmpty(getIntent().getStringExtra(INTENT_TYPE))) {
            type = getIntent().getStringExtra(INTENT_TYPE);
        }

        if (TYPE_PAY_SUCCESS.contentEquals(type)) {
            textView.setText("支付成功");
        }
        mPaySuccessBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(PaySuccessActivity.this,MyOrderActivity.class);
                startActivity(intent);
                finish();
            }
        });
    }

    @Override
    public void bindData() {

    }

    @Override
    public void onUserLogin(LoginMessage loginMessage) {

    }
}
